import unittest

from framework.AW.STrak import strak
from framework.AW.STrak.process import *
from framework.AW.STrak.strak import *
from framework.AW.STrak.station import *
from framework.AW.Config.config import *
from framework.AW.STrak.car import *


def multiStation_operation():
    try:
        """
        配置：上海S3样机（环线）\单工序多工位
        2小车 间距300mm
        关闭多工位工序的模拟完成信号 
        重新启动包含以下动作：急停初始化复位(使能)启动
        小车都停下后读取多工位工序对应的到位信号
        开启多工位工序的模拟完成信号 
        两车同时出发 先读取到位的系统小车号
        """
        simulate_signal_off(2)
        restart()
        read_at_pos_signal(2)
        read_at_pos_signal(3)
        simulate_signal_on(2)
        car_start_together_check([1, 2])

    except Exception as e:
        print(f"测试过程出现异常:{e}")
        raise


class MultiStationOperation(unittest.TestCase):
    @staticmethod
    def testOn():
        multiStation_operation()
